import QtQuick 1.0

Rectangle {
    id: simplebutton
    color: "lightgreen"
    radius: 10
    width: buttonLabel.width + 30; height: buttonLabel.height + 30
    smooth: true

    signal clicked

    property alias text: buttonLabel.text

    Text{
        id: buttonLabel
        anchors.centerIn: parent
        text: "button label"
    }

    gradient: Gradient {
        GradientStop { position: 0.0; color: simplebutton.color }
        GradientStop { id: gradientStop; position: 0.5; color: Qt.lighter(simplebutton.color, 1.5)}
        GradientStop { position: 1.0; color: simplebutton.color }
    }

    MouseArea {
        id: mouseArea
        anchors.fill: parent
        onClicked: { parent.clicked() }
    }

    states: State {
        name: "pressed"
        when: mouseArea.pressed
        PropertyChanges { target: gradientStop; color: Qt.darker(simplebutton.color, 1.5)}
    }
}
